import axios from 'axios';
import { Toast } from 'vant';

//配置根路径
const service = axios.create({
  // baseURL: 'http://itfly.vip'
  // baseURL: 'http://localhost:3000'
  baseURL: 'http://121.89.205.189:3001',
});

service.interceptors.request.use((config) => {
  config.headers.token = localStorage.getItem('token')
  return config;
});

service.interceptors.response.use(
  (response) => {
    return response;
  },
  (err) => {
    Toast('网络请求失败.....');
    Promise.reject(err);
  }
);

export default service;
